命令行用法 Python
如需脚本自动化,可直接调用 replace.py:
python replace.py \
--input "文档.docx" \
--output "文档_替换后.docx" \
--rules "旧词A=新词B" "旧词C=新词D" "旧词E=新词F"
# 从 JSON 文件读取规则(支持大量规则)
python replace.py \
--input "文档.docx" \
--output "文档_替换后.docx" \
--rules-file rules.json \
--ignore-case
JSON 规则文件格式:[{"find":"旧词","replace":"新词"}, ...]